-
Notifications
You must be signed in to change notification settings - Fork 4.8k
oc: Use default resources where it makes sense #4947
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
oc: Use default resources where it makes sense #4947
Conversation
pkg/cmd/cli/cmd/deploy.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lowercase?
|
This command is requiring resource/name format: https://github.com/openshift/origin/blob/master/pkg/cmd/cli/secrets/add_secret_to_obj.go |
For two args, no less |
|
[test] |
|
@deads2k jenkins is green, merge at your will |
|
Are there tests to make sure prior invocations still work correctly? |
|
|
I agree it should, just not sure it does :) |
I've updated the first post with more details about and I've also updated test-cmd to test all cases. |
pkg/cmd/cli/cmd/startbuild.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems like something that should be handled by resource builder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not using the resource builder here because it would try to get the buildConfig (which we are not interested in) in order to start the build. Instead, I think using the RESTMapper to resolve the resource type is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes me believe that what you are representing here is a common pattern
that should be abstracted either into resource.Builder (but without the
fetch) or as supporting utility code in the cmd packages.
On Oct 11, 2015, at 3:38 PM, Michail Kargakis [email protected]
wrote:
In pkg/cmd/cli/cmd/startbuild.go
#4947 (comment):
name := buildName
isBuild := true
- if len(name) == 0 {
name = args[0]- if len(name) == 0 && len(args[0]) > 0 {
parts := strings.Split(args[0], "/")
I am not using the resource builder here because it would try to get the
buildConfig (which we are not interested in) in order to start the build.
Instead, I think using the RESTMapper to resolve the resource type is
enough.
—
Reply to this email directly or view it on GitHub
https://github.com/openshift/origin/pull/4947/files#r41714535.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added an utility under origin/pkg/cmd/util to handle this.
|
re[test] |
|
go stdlib race rere[test] |
|
Tagging more eyes: @ironcladlou about deploy |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think what you really want is a way to get a canonical resource representation. Something where you get "imagestreamtag" back for "istag", "istags", "imagestreamtags" in any case. If multiple resources deal in the same kind, this breaks because "notAnIsTag/foo" would match.
I asked @smarterclayton if he knew whether it existed, he said he'd look for it/make it.
|
[test] |
|
[test] |
|
Test flake in #5410 On Sat, Oct 24, 2015 at 6:00 PM, OpenShift Bot [email protected]
|
pkg/cmd/cli/cmd/startbuild.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't you need to make sure you got back a non-empty name? I would do so after this block, to catch the case where len(args[0]) == 0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
one question on fromRepo, fromFile, etc interaction from @smarterclayton, then lgtm |
|
we're safe. On Tue, Oct 27, 2015 at 4:32 PM, Jordan Liggitt [email protected]
|
pkg/cmd/cli/cmd/startbuild.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move this check outside the if block to catch cases where len(name)==0, but len(args[0]) == 0, for example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
|
Evaluated for origin test up to e30dccd |
|
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin/6430/) |
|
LGTM, ready to merge? |
|
Lets do it |
|
[merge] |
|
continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_requests_origin/3879/) (Image: devenv-rhel7_2614) |
|
Evaluated for origin merge up to e30dccd |
Merged by openshift-bot
Commands I have defaulted using the builder/RESTMapper in this PR:
(Was using both syntaxes before, now achieves it via the resource builder.)
(Was using both syntaxes before, now achieves it via the RESTMapper.)
(Was using only NAME syntax, now uses bc/NAME too.)
(Was using only TYPE/NAME syntax, now uses NAME too.)
(Was using only NAME syntax, now uses build/NAME too.)
@smarterclayton @fabianofranz
Fixes #4781
Fixes #1995